Skip to content

add extra origin information for deprecation diagnostics#38052

Merged
DanielMSchmidt merged 11 commits intomainfrom
deprecation-diagnostics-extra-origin
Feb 3, 2026
Merged

add extra origin information for deprecation diagnostics#38052
DanielMSchmidt merged 11 commits intomainfrom
deprecation-diagnostics-extra-origin

Conversation

@DanielMSchmidt
Copy link
Copy Markdown
Contributor

@DanielMSchmidt DanielMSchmidt commented Jan 12, 2026

PR Chain

Screenshot 2026-01-14 at 15 19 19

Attaches and displays extra information on diagnostics about the origin of deprecated values.

Fixes #

Target Release

1.15.x

Rollback Plan

  • If a change needs to be reverted, we will roll out an update to the code within 7 days.

Changes to Security Controls

Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.

CHANGELOG entry

  • This change is user-facing and I added a changelog entry.
  • This change is not user-facing.

@DanielMSchmidt DanielMSchmidt added the no-changelog-needed Add this to your PR if the change does not require a changelog entry label Jan 12, 2026
@DanielMSchmidt DanielMSchmidt force-pushed the deprecation-diagnostics-extra-origin branch 3 times, most recently from 6e72b27 to a12e649 Compare January 13, 2026 14:31
@DanielMSchmidt DanielMSchmidt marked this pull request as ready for review January 13, 2026 14:32
@DanielMSchmidt DanielMSchmidt requested a review from a team as a code owner January 13, 2026 14:32
@DanielMSchmidt DanielMSchmidt force-pushed the deprecation-diagnostics-extra-origin branch from fbfd15f to ca88f6f Compare January 14, 2026 13:15
Copy link
Copy Markdown
Member

@jbardin jbardin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something we need to be careful of is that UnmarkDeep is a very expensive operation, so it needs to be kept out of any hot paths in Terraform. I'm not seeing anything concerning yet after removing the recursive validation in count/for_each, but I can take a closer look on the other PRs too.

@DanielMSchmidt DanielMSchmidt force-pushed the deprecation-diagnostics-extra-origin branch 7 times, most recently from e7bf756 to 1becc84 Compare January 20, 2026 16:20
@DanielMSchmidt DanielMSchmidt force-pushed the deprecation-diagnostics-extra-origin branch from 1becc84 to 1f5c492 Compare January 20, 2026 16:27
@DanielMSchmidt DanielMSchmidt force-pushed the deprecations-in-variables-and-outputs branch from daa048d to 710afaa Compare January 20, 2026 19:35
@DanielMSchmidt DanielMSchmidt force-pushed the deprecation-diagnostics-extra-origin branch 2 times, most recently from a52acd5 to 63e51e0 Compare January 20, 2026 19:46
@DanielMSchmidt DanielMSchmidt force-pushed the deprecations-in-variables-and-outputs branch from 710afaa to fed3ea9 Compare January 21, 2026 08:25
@DanielMSchmidt DanielMSchmidt force-pushed the deprecation-diagnostics-extra-origin branch from 63e51e0 to de0d028 Compare January 21, 2026 08:30
@DanielMSchmidt DanielMSchmidt force-pushed the deprecations-in-variables-and-outputs branch from fed3ea9 to a9cb1c9 Compare January 21, 2026 14:35
@DanielMSchmidt DanielMSchmidt force-pushed the deprecation-diagnostics-extra-origin branch 4 times, most recently from 4f969c4 to 3f705da Compare January 22, 2026 14:58
@DanielMSchmidt DanielMSchmidt force-pushed the deprecations-in-variables-and-outputs branch from a9cb1c9 to f877341 Compare January 26, 2026 08:49
jbardin
jbardin previously approved these changes Feb 2, 2026
@DanielMSchmidt DanielMSchmidt force-pushed the deprecations-in-variables-and-outputs branch from d79bf08 to 0ae6944 Compare February 3, 2026 12:26
@DanielMSchmidt DanielMSchmidt force-pushed the deprecation-diagnostics-extra-origin branch from f2387a8 to 0219ba0 Compare February 3, 2026 12:27
@DanielMSchmidt DanielMSchmidt force-pushed the deprecations-in-variables-and-outputs branch from 0ae6944 to 51c8cb5 Compare February 3, 2026 14:41
Base automatically changed from deprecations-in-variables-and-outputs to main February 3, 2026 14:57
@DanielMSchmidt DanielMSchmidt dismissed jbardin’s stale review February 3, 2026 14:57

The base branch was changed.

We want to be able to give better information if e.g. the entire module is stored in a local and the deprecated value is only later used.

Where the diag is emitted we might only see the local and not the true origin of the deprecation

A string identifying the source of the deprecation should help
…rtain locations

Mainly terminal locations for the value where they are used, such as the config of a resource, for_each, outputs.
We don't want to evaluate the deprecation deeply when it comes to values where the value is not yet used, e.g. locals
This is because if e.g. a deeply nested value is deprecated it should still be ok for the entire object to be in a local
whereas the same object should give a warning in e.g. an output
@DanielMSchmidt DanielMSchmidt force-pushed the deprecation-diagnostics-extra-origin branch from 0219ba0 to b77a475 Compare February 3, 2026 14:58
@DanielMSchmidt DanielMSchmidt merged commit 379fa79 into main Feb 3, 2026
7 checks passed
@DanielMSchmidt DanielMSchmidt deleted the deprecation-diagnostics-extra-origin branch February 3, 2026 15:04
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 6, 2026

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

no-changelog-needed Add this to your PR if the change does not require a changelog entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants